#!/usr/bin/env bash
if [ -f /etc/os-release ]; then
	codename=$(grep 'VERSION_CODENAME' /etc/os-release | cut -d= -f2 | tr -d '"')
	tee /etc/apt/sources.list.d/tsinghua.sources >/dev/null <<EOF
Types: deb
URIs: https://mirrors.tuna.tsinghua.edu.cn/debian
Suites: $codename $codename-updates $codename-backports
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb
URIs: https://mirrors.tuna.tsinghua.edu.cn/debian-security
Suites: $codename-security
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF
	>/etc/apt/sources.list
	apt update
fi

# bash -c "$(wget https://gitee.com/hevey88/install_script/raw/main/debian_write_source.sh -O -)"
